package com.app.megaprosoft.modyimcarcare;

import java.sql.Connection;
import java.sql.ResultSet;
import java.util.Calendar;

import com.app.megaprosoft.DB.Connect;

import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.widget.Toast;


public class Service_BroadcastUpdateToServer extends BroadcastReceiver{
	
    Connect con = new Connect(); 
    Connection conn = con.Connect();
    ResultSet rs = null;
    
	@Override
	public void onReceive(Context context, Intent intent) {
		// TODO Auto-generated method stub
		String action = intent.getAction();
		if(action.equals(Intent.ACTION_TIME_TICK)){
			context.startService(new Intent(context,Service_UpdateToServer.class));	
			Toast.makeText(context, "Intent Detected.", Toast.LENGTH_LONG).show();
//			switch (Calendar.getInstance().get(Calendar.SECOND)){
//			case 1:
//				context.startService(new Intent(context,Service_UpdateToServer.class));
//				break;
//			default :
//				context.stopService(new Intent(context,Service_UpdateToServer.class));
//				break;
//			}
		}
	}
}
